home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 480.lha / SmartField / Docs / Field Layout.pp / Field Layout
Encoding:
Text File  |  1991-02-11  |  3.7 KB  |  109 lines

  1. FIELD LAYOUT
  2.  
  3.  
  4. This section describes the suggested field border and title placement and the
  5. creation of the Right and Bottom parameters in the Field structure.
  6.  
  7. Using the default Workbench font Topaz-80, each character is 8x8 pixels in
  8. size.  The format shown below is recommended for fields in windows on the
  9. Workbench screen or any screen that uses a 640x200 resolution.  You may use
  10. adapt the same theory to other resolution screens.  The borders shown below
  11. are the same as those that appear on the Vendor Maintenance example program.
  12. The inside border is rendered white (pen 1), and the outside border serves as
  13. a "shadow" and is rendered black (pen 2).
  14.  
  15. The diagram is an example of a field where MaxChars equals 2 (in other words,
  16. there is only one visible character).
  17.  
  18. The characters used in the diagram below have the following
  19. meaning:
  20.     T - pixel occupied by the first character in the field title.
  21.     1 - pixel occupied by the first character in the field contents.
  22.     2 - pixel occupied by the second character in the field contents.
  23.         Note that this is the terminal null and is not displayed.
  24.     * - pixel at the Left,Top window location
  25.     # - pixel occupied by the inside field border
  26.     $ - pixel occupied by the outside field border
  27.     + - blank pixel, shown only for reference
  28.  
  29. TTTTTTTT <-- Top - 11
  30. TTTTTTTT
  31. TTTTTTTT
  32. TTTTTTTT
  33. TTTTTTTT
  34. TTTTTTTT
  35. TTTTTTTT
  36. TTTTTTTT
  37. ++++++++
  38. ####################   <-- Top - 2
  39. #++++++++++++++++++#$$
  40. #++*111111122222222#$$ <-- Top
  41. #++1111111122222222#$$
  42. #++1111111122222222#$$
  43. #++1111111122222222#$$
  44. #++1111111122222222#$$
  45. #++1111111122222222#$$
  46. #++1111111122222222#$$
  47. #++1111111122222222#$$ <-- Top + window->IFont->tf_YSize - 1
  48. ####################$$     or  Bottom - window->BorderBottom
  49.   $$$$$$$$$$$$$$$$$$$$
  50.  
  51. ^  ^              ^
  52. |  Left           Left + MaxChars * window->IFont->tf_XSize - 1
  53. |                 or  Right - window->BorderRight
  54. Left - 3
  55.  
  56.  
  57. Notes:
  58.  
  59. The bottom line of text used by the field contents is blank for all but those
  60. characters which have "drops", such as g, p, q, etc.
  61.  
  62. You must leave room for the terminal null even though it is never actually
  63. displayed.  This is because the nature of the console device causes it to
  64. "borrow" imagery from this character position when a character is deleted.
  65. Thus, any border imagery rendered in the null position will be trashed.
  66.  
  67. The field_click() function only checks the area occupied by the field text
  68. for a mouse click.  It has nothing to do with the field borders.  In the
  69. above diagram, the pixels represented by the 1's, 2's, and * would return
  70. positive for a mouse click within that field.
  71.  
  72. The Right border is calculated by adding the window->BorderRight parameter to
  73. the right-most pixel of the null character in the field.  The Bottom border
  74. is calculated by adding the window->BorderBottom parameter to the bottommost
  75. pixel of the field text.
  76.  
  77. The entire visible portion of the field (considered to be the rectangle
  78. bounded by Left,Top and Right,Bottom) must be within the visible portion of
  79. the window for the field to be active.
  80.  
  81.  
  82. IntuiText structures:
  83.  
  84. To place the field title in the position as shown above, set:
  85.     field->FieldTitle->LeftEdge = field->Left - 3
  86.     field->FieldTitle->TopEdge  = field->Top - 11
  87.  
  88.  
  89. Border structures:
  90.  
  91. To create the borders as shown above, set:
  92.     border1.LeftEdge = border2.LeftEdge = field->Left - 3
  93.     border1.TopEdge  = border2.TopEdge  = field->Top - 2
  94.  
  95. And create the following pairs:
  96.     pairs2[] = { 0,0, C*X,0, C*X,Y+2, 0,Y+2, 0,0 };
  97.     pairs1[] = { 2,Y+3, C*X+1,Y+3, C*X+1,1, C*X+2,1, C*X+2,Y+3 };
  98.     where:
  99.         C = field->MaxChars
  100.         X = window->IFont->tf_XSize
  101.         Y = window->IFont->tf_YSize
  102.  
  103.  
  104. Field Layout  01/13/90
  105. © Copyright 1990 Timm Martin
  106. All Rights Reserved Worldwide
  107.  
  108. /*-- END --*/
  109.